var wrap = document.getElementById("wrap");
var cxt = wrap.getContext("2d");
(function drawSpectrum () {
    cxt.clearRect(0, 0, wrap.width, wrap.height);
    //画线条
    for (var i = 0; i < 360; i++) {
        var value = 8;
        cxt.beginPath();
        cxt.lineWidth = 2;
        cxt.moveTo(300, 300);
        //R * cos (PI/180*一次旋转的角度数) ,-R * sin (PI/180*一次旋转的角度数)
        cxt.lineTo(Math.cos((i * 1) / 180 * Math.PI) * (200 + value) + 300, (- Math.sin((i * 1) / 180 * Math.PI) * (200 + value) + 300));
        cxt.stroke();
    }
    //画一个小圆，将线条覆盖
    cxt.beginPath();
    cxt.lineWidth = 1;
    cxt.arc(300, 300, 200, 0, 2 * Math.PI, false);
    cxt.fillStyle = "#fff";
    cxt.stroke();
    cxt.fill();
})();